package com.carlinfo.stu_ques.question.dao.impl;

import java.io.File;

import com.carlinfo.stu_ques.common.dao.impl.BaseDaoimpl;
import com.carlinfo.stu_ques.question.dao.IQuestionDao;
import com.carlinfo.stu_ques.question.pojo.Question;

public class QuestionDaoImpl  extends BaseDaoimpl<Question> implements IQuestionDao
{
	File file = new File(parentFile,"question.dat");
	@Override
	public int savaOneDao(Question t)
	{
		t.setId(count);
		tempId = t.getId();
		int result = super.savaOneDao(t);
		writeFile(file);
		return  result;
	}

	@Override
	public void updateOneDao(Question t)
	{
		tempId = t.getId();
		super.updateOneDao(t);
		writeFile(file);
	}

	@Override
	public void deleteOneDao(Question t)
	{
		tempId = t.getId();
		super.deleteOneDao(t);
		writeFile(file);
	}
	public QuestionDaoImpl()
	{
		readFile(file);
	}

}
